package com.gaoyang.thread;

import com.gaoyang.util.API_URL;
import com.gaoyang.util.HttpUtils4Black;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.Map;

public class SimpleRunner4Qiang implements Runnable
{

    private Logger logger = LogManager.getLogger(SimpleRunner4Qiang.class);

    String userName = "";
    String productName = "";
    private Map<String, String> params;

    public void setRunIndex(String userName, String productName,  Map<String, String> params)
    {
        this.params = params;
        this.userName = userName;
        this.productName = productName;
    }
  
    public void run()   
    {  
        try  
        {  
            //3秒内随机时间结束  
//            Thread.sleep((long) (Math.random() * 3000));
//
//            for (int i = 0; i< 2; i++) {
                String productUrl = API_URL.ZSYH_ADDRESS3 + API_URL.ZSYH.LAGANXIANG;;
                String result = HttpUtils4Black.postUrl4ZSYH(productUrl, params);
                logger.info("start run:" + userName + " " + productName + result);
//            }

        } catch (Exception e)
        {  
            // TODO Auto-generated catch block  
            e.printStackTrace();  
        }  
    }  
}  
